// 题意：一维坐标轴上n个点，给每个点加个权，求一个点使得每个点到这个点加权距离
// 		 和最小。
//
// 题解：根据高中学过的不等式知识，肯定在这些点上取到，贪心一次就好。
//

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>

struct pos_amount { double p; long long a; };

bool operator<(pos_amount const & a, pos_amount const & b)
{
	return a.p < b.p;
}

long long n;
std::vector<pos_amount> da;
std::vector<long long> sum_prefix;

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n;
	da.resize(n);
	sum_prefix.resize(n);

	long long sum = 0;
	for (long long i = 0; i < n; i++) {
		std::cin >> da[i].p >> da[i].a;
		sum += da[i].a;
	}

	std::sort(da.begin(), da.end());

	double pos = da[0].p;
	long long sum_min = 0;
	sum_prefix[0] = da[0].a;
	for (long long i = 1; i < n; i++) {
		sum_prefix[i] = sum_prefix[i-1] + da[i].a;
		sum_min += (da[i].p - pos) * da[i].a;
	}

	long long sum_now = sum_min;
	for (long long i = 1; i < n; i++) {
		sum_now += sum_prefix[i-1] * (da[i].p - da[i-1].p);
		sum_now -= (sum - sum_prefix[i-1]) * (da[i].p - da[i-1].p);
		if (sum_now < sum_min) {
			sum_min = sum_now;
			pos = da[i].p;
		}
	}

	std::cout << std::setprecision(5) << std::fixed << pos << '\n';
}

